package com.xja.controller;

import com.xja.model.vo.resp.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 蔡建国
 * Date  2025/6/12 8:37
 */
@RestController
@Tag(name = "测试接口")
public class TestController {
    @Operation(summary = "测试1")
    @GetMapping("/test")
    public Result<String> test() {
        return Result.success("hello world");
    }

    @GetMapping("/test/hello")
    public Result<Integer> test2() {
        int sum = 0;
        for (int i = 0; i < 10000; i++) {
            sum += i;
        }
        return Result.success(sum);
    }
}